<template>
  <div class="app-container">
    <div class="servicemoney">
      <el-form :model="form" label-width="80px" label-position="left">
        <span>提现手续费</span>
        <span>=</span>
        <span>提现金额</span>
        <span>X</span>
        <el-input class="percent" style="text-align: center;" v-model="form.percent" />
        <span>%</span>
      </el-form>
      <div class="savebth">
        <el-button type="primary" @click="onSubmit">保存</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import { walletList,savewallet } from "@/api/wallet";
export default {
  name: "Dashboard",
  computed: {},
  data() {
    return {
      form: {
        percent: "",
        id:''
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      walletList().then((response) => {
        console.log(response);
        this.form.percent = response.result.amountPercentage;
        this.form.id=response.result.id
        // setTimeout(() => {
        //   this.listLoading = false;
        // }, 1.5 * 1000);
      });
    },
    onSubmit() {
      let parm={
          id:this.form.id,
          amountPercentage:this.form.percent
      }
     // console.log(parm)
      
      savewallet(parm).then((response) => {
        console.log(response);
         this.$notify({
            title: '成功',
            message: '保存成功',
            type: 'success',
            duration: 2000
          })
       this.getList()
        // setTimeout(() => {
        //   this.listLoading = false;
        // }, 1.5 * 1000);
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.servicemoney {
  font-size: 16px;
  color: #808080;
}
.percent {
  width: 70px;
  height: 30px;
  margin: 0 8px;
 
}
.savebth {
  margin-top: 50px;
}
</style>